package org.example.y24.m10;
class Weapon {
    public String name;
    public int attack;
    public Weapon(String name, int attack) {
        this.name = name;
        this.attack = attack;
    }
}
class Character {
    public Weapon weapon;
    public Character(Weapon weapon) {
        this.weapon = weapon;
    }
}
//使用IoC创建类
class IoC {
    public static <T> T getBean(Class<T> clazz) {
        return null;
    }
}
public class IoCMain {
    public static void main(String[] args) {
        Weapon sword = IoC.getBean(Weapon.class);
        Character warrior = IoC.getBean(Character.class);
    }
}
